
<template>
	<view>
		<!-- 占位栏 -->
		<view class="w-100" :style="{marginTop:topbar+'px'}"></view>
		<u-navbar
			title="搜索页面"
			@rightClick="navBack"
			:autoBack="true"
		>
		</u-navbar>
		
		<d-search-log 
		:color_border="color_border"
		:color_text="color_border"
		:search_list_hot="search_list_hot"
		:store_key="store_key"
		:input_text="input_text"
		@onClickDelAllApi="onClickDelAll"
		@onSearchNameApi="onSearchName"
		></d-search-log>
		
		
		
	</view>
</template>

<script>
	import {
		tokenAout,indexStoreSearchHot 
	} from '@/common/http/api.js'
	export default {
		components: {
			 
		},
		computed:{
			
		},
		data() {
			return {
				topbar:50,
				color_border:"#ff00ff",
				search_list_hot:[],
				store_key:'search_list',
				input_text:''
			}
		},
		onLoad() {
			var that = this
			this.topbar=getApp().globalData.customBar;
			//  搜索
			this.indexStoreSearchHotHttp();
			 
		},
		methods: {
			navBack(){
				uni.navigateBack();
			},
			onClickDelAll() {
				console.log('[父级接收事件]：删除全部搜索记录')
			},
			onSearchName(e) {
				console.log('[父级接收事件]：点击搜索:'+e)
				uni.redirectTo({
					url:'/pages/discover/discover?ketword='+e
				})
			},
			// 热搜
			async indexStoreSearchHotHttp(){
				await indexStoreSearchHot({}).then(res=>{
					this.search_list_hot=res.data;
				})
			},
		
			 
			// 
		}
	}
</script>

<style>
	page {
		/* background-color: #f2f2f2; */
	}
	.my-theme-bg {
		background: linear-gradient(117deg,#60DF9D,#31CB7B);
		color:#fff;

	}
</style>